﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["CurrentUser"] = null;
    }
    protected void submit_id_Click(object sender, EventArgs e)
    {
        



        //Response.Redirect("FormUfv.aspx");
       // ModLogin login = new ModLogin();
        //string user = "";
        //string pass = "";
        //user = this.login_id.Value;
        //pass = this.passwd_id.Value;
        //Tbl_Usuarios usuarioActual = login.login(user, pass);
       /* if (usuarioActual != null)
        {
            Session["CurrentUser"] = usuarioActual;//change to the user instance that'll be returned from the DB
            Response.Redirect("~/content/index.aspx");
        }
        else
        {
            this.login_id.Value = "Credenciales de Usuario no son las correctas";
        }*/
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    
    }
   
    protected void submit_id_Click2(object sender, EventArgs e)
    {
    


        
        UsuariosBLL usuario = new UsuariosBLL();
        Usuarios verificacion = usuario.Autentificar_Usuario(txblogin_id.Text, txbpasswd_id.Text);
        if (verificacion != null)
        {
            Session["UsuarioActual"] = verificacion;

            Response.Redirect("index.aspx");
            
        }
        lblError.Text = "Usuario y/o Password Incorrecto";
        //lblError.Text = md5Hash;
        txblogin_id.Text = " ";
        txbpasswd_id.Text = " ";
        
    }
   
}